<?php
class social extends adminController {
	public function __construct() {
		parent::__construct ();
        $this->session->set_userdata('selectedMenuAdmin', 'social');
	}
	
    public function loadView($temp) {
        if (!isset($temp['data']))
            $temp['data'] = '';
        $this->load->view('admin/template', $temp);
    }
    
    public function edit($id=1) {
        $this->_data['template'] = 'admin/social/edit';
        if(!$this->isPost()) {
            $this->_data['data'] = $this->socialModel->read($id);
            $this->loadView($this->_data);
            return;   
        }
        $this->socialModel->update($this->input->post(), array('id' => $id));
        redirect(base_url().'admin/social/edit');
    }
}
?>